import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import './plugins/element.js'
import './font/iconfont.css'
import "./router/permission"
import jwt from "jwt-decode"
import "./assets/common.css"
import "./utils/eventbus.js"
//引入vant
// import './plugins/vant.js'
//头部组件提成全局 
import HandNav from './components/HandNav'
//轮播图插件引入
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/css/swiper.css'






Vue.use(HandNav)

//全局定义返回上一级方法
Vue.prototype.back = () => router.back(-1)

//轮播图插件引入
Vue.use(VueAwesomeSwiper)

//登录刷新不跳页面
if (localStorage.getItem("rttub")) {
  store.commit("loginModule/setUser", {
    username: jwt(localStorage.getItem("rttub")).username,
    token: localStorage.getItem("rttub")
  })
}
Vue.config.productionTip = false


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
